uDig

«  What to Do Next   ::   Contents   ::   GeoScript Introduction  »

Introduction to the Spatial Toolbox

The Spatial Toolbox View gives the possibility to execute tools from loaded libraries on resources visualized in uDig.

Related reference

Spatial Toolbox view

Here is an example of the spatial toolbox in action:

Before you Start

Download the Spearfish example data

In the example we will use a raster elevation model of the Spearfish region.

  1. Download the following file (you can right click and choose Save as in most browsers):

    spearfish_elevation.zip (spearfish_elevation.zip)

  2. Unzip it to your data directory or desktop

  3. This download contains:

    • elevation.asc
    • elevation.prj
  4. Try to drag it into uDig to visualy confirm height data looking like the following.

    Tip

    You can use the Style Editor to fill in a color map for the raw elevation data

The Spatial toolbox View

Once your raster is loaded you are ready to start to configure the spatial toolbox. First let’s open it up:

  1. Find it under Window ‣ Show View ‣ Other…

  2. And then choose the Spatial toolbox:

  3. It will probably open up a bit too small, so best thing is to detach it and use it in a separate window anyways.

  4. To do so right click on the view’s bar:

  5. And voila’!

Installing JGrasstools

The spatial toolbox is able to load and generate graphical user interfaces and link together models that are developed as OMS3 services.

Note

OMS3

Object Modeling Services 3 is a standard used for component development employed by the jgrass project. If you are interested in the details please have a look here:

To load the modules:

  1. Currently one library of spatial tools implemented using OMS3 is the jgrasstools library.

  2. Therefore it is possible to jump on the jgrass website to get a processing library to use it in uDig.

  3. To start to have some fun we need to download several jar files.

    At the time of writing the jgrass 0.7.2 is being packaged for your use.

  4. You can download these files anywhere; for today we will be placing them in a “jgrass” folder in your home directory.

  5. Create a “jgrass” folder in your home directory

  6. Download the above files and place them in the jgrass folder

  7. Then push the Settings Panel icon on the toolbar (the last icon at the end).

  8. Which will open the settings dialog:

  9. The settings dialog allows you to load the libraries by using the + button.

  10. Load the two libraries that you downloaded.

  11. It should, apart of the different paths of the files, like like the following:

  12. Once you push the ok button, uDig will search for modules inside the library

  13. Congratulations; the toolbox should now display the modules that were found

Processing

The jgrass project provides a host of valuable processes you can try out; for now we will start with a simple example.

Generating Aspect of an Elevation Model

To try out spatial processing we will simply create a map of aspect using the elevation model you already loaded from the sample dataset.

  1. Type in the search box the letters: asp

  2. The “Aspect” module should appear in the list:

  3. Please select the Aspect module.

    Each module provides two tabs:

    • inputs tab: used to fill in the information required to run
    • description tab: details and background on the module.
  4. We will now set up the Aspect service to work with our sample digital elevation model.

  5. To define the input raster to process, we need to fill in The map of the digital elevation model (DEM):

    The simplest thing is to drag aspect raster layer from the udig layer view into the textfield and let udig do the rest.

    ..note: To browse the file system use the button to open a file dialog.

    ../_images/spatial_toolbox_14.png
  6. Next we can provide the path for the generated file.

    This time we can not drag an existing raster (as we have not created it yet) so we will have to use the button to browse. The button will open in the same folder of the last inserted raster and allow us to supply a filename.

    Type in the filename aspect.asc to create an esri ascii also as output.

    ../_images/spatial_toolbox_15.png
  7. Before we run the module there are a couple of configuration options that are useful to control.

    The most important is the amount of memory that we permit the module to use:

    ../_images/spatial_toolbox_16.png

    In the above example the local machine has 8 gigabytes of RAM, allowing us to easily allocate 2000 megabytes for for the work.

    Please set an appropriate value your your machine.

  8. To execute the module please click the run button in the view toolbar

    ../_images/spatial_toolbox_17.png

    The module will execute opening a console window that gives feedback on what is going on.

  9. Once the process is done, the resulting map is loaded in the map window

    ../_images/spatial_toolbox_18.png

Things to Try

Congratulations on finishing this tutorials; here are a couple of things to try:

  • Review the documentation of some of the other services made available
  • Check out the jgrass website for additional information about the project

«  What to Do Next   ::   Contents   ::   GeoScript Introduction  »